@echo off
set PRJ_NAME=ALL_FW
set AXF_DIR=.\%PRJ_NAME%_Data\VSN_V2_FLASH
set AXF_NAME=%PRJ_NAME%.axf
set RAM_DIR=%AXF_DIR%
set PKG_DIR=%AXF_DIR%
set PKG_NAME=VSN_V2FW
set H_DIR=%AXF_DIR%
set ROMPKG_NAME=AIT842ROMPackage

@echo on
::copy c:\aitfw\82x\VSN_V2BC %PKG_DIR%\VSN_V2BC 
fromELF.exe -c -bin %AXF_DIR%\%AXF_NAME% -output %RAM_DIR%\ALL_DRAM
..\FirmwarePackager .\ldsfile_VSN_V2_flash.txt %RAM_DIR%\ %PKG_DIR%\%PKG_NAME% /q

@if errorlevel 1 (
  @echo.
  @echo Error on Packing FW
  @pause
  @goto :EOF )

:: old FW packager
..\MergeFirmwarePackage 2 %PKG_DIR%\VSN_V2FWImage.bin %PKG_DIR%\VSN_V2BC %PKG_DIR%\%PKG_NAME%

@if errorlevel 1 ( 
  @echo.
  @echo Error on Merging Packages
  @pause
  @goto :EOF )

copy %PKG_DIR%\VSN_V2FWImage.bin c:\aitfw\82x\

@if errorlevel 1 (
  @echo.
  @echo Error on Copying files
  @pause
  @goto :EOF )

:: new ROM packager
::..\ROMPackager %PKG_DIR%\RomPackageDesc.ini %PKG_DIR%\%ROMPKG_NAME%.rom
::copy %PKG_DIR%\%ROMPKG_NAME%.rom c:\aitfw\82x\

::pause

